home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / nfs / amd / amd-5.2 / rpcx / mount_xdr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-23  |  3.3 KB  |  192 lines

  1. /*
  2.  * $Id: mount_xdr.c,v 5.2 90/06/23 22:20:21 jsp Rel $
  3.  *
  4.  * Copyright (c) 1989 Jan-Simon Pendry
  5.  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
  6.  * Copyright (c) 1989 The Regents of the University of California.
  7.  * All rights reserved.
  8.  *
  9.  * This code is derived from software contributed to Berkeley by
  10.  * Jan-Simon Pendry at Imperial College, London.
  11.  *
  12.  * Redistribution and use in source and binary forms are permitted provided
  13.  * that: (1) source distributions retain this entire copyright notice and
  14.  * comment, and (2) distributions including binaries display the following
  15.  * acknowledgement:  ``This product includes software developed by the
  16.  * University of California, Berkeley and its contributors'' in the
  17.  * documentation or other materials provided with the distribution and in
  18.  * all advertising materials mentioning features or use of this software.
  19.  * Neither the name of the University nor the names of its contributors may
  20.  * be used to endorse or promote products derived from this software without
  21.  * specific prior written permission.
  22.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  23.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  24.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  25.  *
  26.  *    %W% (Berkeley) %G%
  27.  */
  28.  
  29. #include "am.h"
  30. #include "mount.h"
  31.  
  32.  
  33. bool_t
  34. xdr_fhandle(xdrs, objp)
  35.     XDR *xdrs;
  36.     fhandle objp;
  37. {
  38.     if (!xdr_opaque(xdrs, objp, FHSIZE)) {
  39.         return (FALSE);
  40.     }
  41.     return (TRUE);
  42. }
  43.  
  44.  
  45.  
  46.  
  47. bool_t
  48. xdr_fhstatus(xdrs, objp)
  49.     XDR *xdrs;
  50.     fhstatus *objp;
  51. {
  52.     if (!xdr_u_int(xdrs, &objp->fhs_status)) {
  53.         return (FALSE);
  54.     }
  55.     switch (objp->fhs_status) {
  56.     case 0:
  57.         if (!xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle)) {
  58.             return (FALSE);
  59.         }
  60.         break;
  61.     }
  62.     return (TRUE);
  63. }
  64.  
  65.  
  66.  
  67.  
  68. bool_t
  69. xdr_dirpath(xdrs, objp)
  70.     XDR *xdrs;
  71.     dirpath *objp;
  72. {
  73.     if (!xdr_string(xdrs, objp, MNTPATHLEN)) {
  74.         return (FALSE);
  75.     }
  76.     return (TRUE);
  77. }
  78.  
  79.  
  80.  
  81.  
  82. bool_t
  83. xdr_name(xdrs, objp)
  84.     XDR *xdrs;
  85.     name *objp;
  86. {
  87.     if (!xdr_string(xdrs, objp, MNTNAMLEN)) {
  88.         return (FALSE);
  89.     }
  90.     return (TRUE);
  91. }
  92.  
  93.  
  94.  
  95.  
  96. bool_t
  97. xdr_mountlist(xdrs, objp)
  98.     XDR *xdrs;
  99.     mountlist *objp;
  100. {
  101.     if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), xdr_mountbody)) {
  102.         return (FALSE);
  103.     }
  104.     return (TRUE);
  105. }
  106.  
  107.  
  108.  
  109. bool_t
  110. xdr_mountbody(xdrs, objp)
  111.     XDR *xdrs;
  112.     mountbody *objp;
  113. {
  114.     if (!xdr_name(xdrs, &objp->ml_hostname)) {
  115.         return (FALSE);
  116.     }
  117.     if (!xdr_dirpath(xdrs, &objp->ml_directory)) {
  118.         return (FALSE);
  119.     }
  120.     if (!xdr_mountlist(xdrs, &objp->ml_next)) {
  121.         return (FALSE);
  122.     }
  123.     return (TRUE);
  124. }
  125.  
  126.  
  127.  
  128.  
  129. bool_t
  130. xdr_groups(xdrs, objp)
  131.     XDR *xdrs;
  132.     groups *objp;
  133. {
  134.     if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), xdr_groupnode)) {
  135.         return (FALSE);
  136.     }
  137.     return (TRUE);
  138. }
  139.  
  140.  
  141.  
  142.  
  143. bool_t
  144. xdr_groupnode(xdrs, objp)
  145.     XDR *xdrs;
  146.     groupnode *objp;
  147. {
  148.     if (!xdr_name(xdrs, &objp->gr_name)) {
  149.         return (FALSE);
  150.     }
  151.     if (!xdr_groups(xdrs, &objp->gr_next)) {
  152.         return (FALSE);
  153.     }
  154.     return (TRUE);
  155. }
  156.  
  157.  
  158.  
  159.  
  160. bool_t
  161. xdr_exports(xdrs, objp)
  162.     XDR *xdrs;
  163.     exports *objp;
  164. {
  165.     if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), xdr_exportnode)) {
  166.         return (FALSE);
  167.     }
  168.     return (TRUE);
  169. }
  170.  
  171.  
  172.  
  173.  
  174. bool_t
  175. xdr_exportnode(xdrs, objp)
  176.     XDR *xdrs;
  177.     exportnode *objp;
  178. {
  179.     if (!xdr_dirpath(xdrs, &objp->ex_dir)) {
  180.         return (FALSE);
  181.     }
  182.     if (!xdr_groups(xdrs, &objp->ex_groups)) {
  183.         return (FALSE);
  184.     }
  185.     if (!xdr_exports(xdrs, &objp->ex_next)) {
  186.         return (FALSE);
  187.     }
  188.     return (TRUE);
  189. }
  190.  
  191.  
  192.